<img id="pic" onclick="jing()" src="deng off.gif" />


<script>
var i = 1;

function jing(){

if(i==1){
pic.src="deng off.gif";
i = 0;

}
else{
pic.src="deng on.gif";
i = 1;
}
}
</script>